Release 10.1A: OpenEdge Development:
Programming Interfaces


XML documents

XML documents are made up of two parts:

DTDs are rules that define the elements that can exist in a particular document or group of documents, and the relationships among the various elements. A DTD can be part of the content of an XML document or can be separate from it and referred to by the documents. Here is an example of a DTD:

<? xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE customer 
[ 
<!ELEMENT customer(name, cust-num)> 
<!ELEMENT name(#PCDATA)> 
<!ELEMENT cust-num(#PCDATA)> 
]> 
<customer> 
<name>Lift Line Skiing</name><cust-num>1</cust-num> 
</customer> 

Elements represent the logical components of documents. They can contain data or other elements. For example, a customer element can contain a number of column (field) elements and each column element can contain one data value. Here is an example of an element:

<name>Clyde</name> 

Elements can have additional information called attributes attached to them. Attributes describe properties of elements. Here is an example of an element with an attribute, emp-num:

<name emp-num="1">Mary</name> 

Here is an example of elements that contain other elements:

<phone><entry><name>Chip</name><extension>3</extension></entry></phone> 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095